<?php

namespace IDock\Insurance\JTIC;

class JTICEnums
{
    public static function getUsageTypeCode($useNatureCode, $causeType, $carKindCode, $vehicleSeat, $vehicleTonnage, &$motorUsageTypeCode, &$motorTypeCode)
    {
        $code = $useNatureCode . '-' . $causeType . '-' . $carKindCode;

        switch ($code) {
            case "01-001-100": //非运营-个人-客车
                $motorUsageTypeCode = '364001';
                break;
            case '01-002-100': //非运营-机关-客车
                $motorUsageTypeCode = '364003';
                break;
            case '01-003-100': //非运营-企业-客车
                $motorUsageTypeCode = '364002';
                break;
        }
        //非营业货车
        if ($useNatureCode == '01' and $carKindCode == '200') {
            $motorUsageTypeCode = '364004';
        }
        //出租客车
        if ($causeType == '004') {
            $motorUsageTypeCode = '364005';
        }
        //城市公交车
        if ($causeType == '006') {
            $motorUsageTypeCode = '364006';
        }
        //公路客运车
        if ($causeType == '007') {
            $motorUsageTypeCode = '364007';
        }
        //营业货车
        if ($useNatureCode == '02' and $carKindCode == '200') {
            $motorUsageTypeCode = '364008';
        }
        //特种车
        if ($carKindCode == '500') {
            $motorUsageTypeCode = '364009';
        }
        //租赁客车
        if ($causeType == '005') {
            $motorUsageTypeCode = '364012';
        }

        //客车
        if ($carKindCode == '100') {
            if ($vehicleSeat < 6) {
                $motorTypeCode = '365001';
            } elseif ($vehicleSeat < 10) {
                $motorTypeCode = '365002';
            } elseif ($vehicleSeat < 20) {
                $motorTypeCode = '365004';
            } elseif ($vehicleSeat < 36) {
                $motorTypeCode = '365011';
            } else {
                $motorTypeCode = '365012';
            }
        }
        //货车
        if ($carKindCode == '200') {
            $vehicleTonnage = ceil($vehicleTonnage / 1000);
            if ($vehicleTonnage <= '2') {
                $motorTypeCode = '365006';
            } elseif ($vehicleTonnage <= '5') {
                $motorTypeCode = '365007';
            } elseif ($vehicleTonnage <= '10') {
                $motorTypeCode = '365008';
            } else {
                $motorTypeCode = '365009';
            }
        }
        //低速载货汽车
        if ($carKindCode == '210') {
            $motorTypeCode = '365010';
        }
        //挂车
        if ($carKindCode == '320') {
            $vehicleTonnage = ceil($vehicleTonnage / 1000);
            if ($vehicleTonnage <= '2') {
                $motorTypeCode = '365025';
            } elseif ($vehicleTonnage <= '5') {
                $motorTypeCode = '365026';
            } elseif ($vehicleTonnage <= '10') {
                $motorTypeCode = '365027';
            } else {
                $motorTypeCode = '365028';
            }
        }
        //特种车
        if ($carKindCode == '500') {
            $motorTypeCode = '365013';
        }
        //特种车挂车
        if ($carKindCode == '600') {
            $motorTypeCode = '365029';
        }
    }


    /**
     * 使用性质
     * @var array $useNatureCode
     */
    public static $useNatureCode = [
        '01' => '非运营',
        '02' => '运营',
    ];

    /**
     * 所属性质
     * @var array $attachNature
     */
    public static $attachNature = [
        '01' => '个人',
        '02' => '机关/团体',
        '03' => '企业'
    ];


    /**
     * 车辆用途
     * @var array $causeType
     */
    public static $causeType = [
        '001' => '家庭自用',
        '002' => '机关自用',
        '003' => '企业自用',
        '004' => '出租客车',
        '005' => '租赁客车',
        '006' => '城市公交',
        '007' => '公路客运',
        '008' => '营运货运',
        '009' => '特殊用途',
    ];

    /**
     * 车辆种类
     * @var array $carKindCode
     */
    public static $carKindCode = [
        '100' => '客车',
        '200' => '货车',
        '210' => '低速载货汽车',
        '320' => '挂车',
        '500' => '特种车',
        '600' => '特种车挂车'
    ];

    /**
     * 能源类型
     * @var string[] $energyType
     */
    public static $energyType = [
        'E00' => '其他',
        'E10' => '无',
        'E01' => '燃油',
        'E02' => '纯电动',
        'E03' => '燃料电池',
        'E04' => '插电式混合动力',
        'E05' => '其他混合动力',
        'E11' => '汽油',
        'E12' => '柴油',
        'E13' => '电动',
        'E14' => '混合油',
        'E15' => '液化石油气',
        'E16' => '天然气',
        'E17' => '甲醇',
        'E18' => '乙醇',
        'E19' => '太阳能',
        'E20' => '混合动力',
        'E21' => '两用燃料',
        'E22' => '燃油电池',
        'E23' => '氢能源',
        'E24' => '生物燃料'
    ];

    /**
     * 进口车标识
     * @var string[] $importFlag
     */
    public static $importFlag = [
        'I0' => '无',
        'I1' => '国产',
        'I2' => '合资',
        'I3' => '进口'
    ];

    /**
     * 进口车标识
     * @var string[] $importFlag
     */
    public static $importFlagReverse = [
        '' => 'I0',
        '国产' => 'I1',
        '合资' => 'I2',
        '进口' => 'I3'
    ];

    /**
     * 号牌颜色代码
     * @var string[] $licenseColorCode
     */
    public static $licenseColorCode = [
        '01' => '蓝',
        '02' => '黄',
        '03' => '黑',
        '04' => '白',
        '05' => '绿',
        '06' => '白蓝',
        '99' => '其他',
    ];

    /**
     * 号牌种类代码
     * @var array $licenseTypeCode
     */
    public static $licenseTypeCode = [
        '01' => '01',
        '02' => '02',
        '03' => '03',
        '04' => '04',
        '05' => '05',
        '06' => '06',
        '07' => '07',
        '08' => '08',
        '09' => '09',
        '10' => '10',
        '11' => '11',
        '12' => '12',
        '13' => '13',
        '14' => '14',
        '15' => '15',
        '16' => '16',
        '17' => '17',
        '18' => '18',
        '19' => '19',
        '20' => '20',
        '21' => '21',
        '22' => '22',
        '31' => '23',
        '32' => '',
        '33' => '24',
        '36' => '31',
        '37' => '32',
        '51' => '51',
        '52' => '52',
        '99' => '25',
    ];

    /**
     * 车型减免税标识
     * @var array $taxReduceCode
     */
    public static $taxReduceCode = [
        'TR0' => '正常',
        'TR1' => '免税',
        'TR2' => '减半',
        'TR3' => '金额减免',
        'TR4' => '比例减免',
    ];

    /**
     * 交管车型代码
     * @var array $vehicleStyleCode
     */
    public static $vehicleStyleCode = [
        'K11 ' => '大型普通客车',
        'K12 ' => '大型双层客车',
        'K13 ' => '大型卧铺客车',
        'K14 ' => '大型铰接客车',
        'K15 ' => '大型越野客车',
        'K21 ' => '中型普通客车',
        'K22 ' => '中型双层客车',
        'K23 ' => '中型卧铺客车',
        'K24 ' => '中型铰接客车',
        'K25 ' => '中型越野客车',
        'K31 ' => '小型普通客车',
        'K32 ' => '小型越野客车',
        'K33 ' => '轿车',
        'K34' => '小型专用客车',
        'K38' => '小型专用校车',
        'K39' => '小型面包车',
        'K41 ' => '微型普通客车',
        'K42 ' => '微型越野客车',
        'K43 ' => '微型轿车',
        'H11' => '重型普通货车',
        'H12' => '重型厢式货车',
        'H13' => '重型封闭货车',
        'H15' => '重型平板货车',
        'H18' => '重型特殊结构货车',
        'H21' => '中型普通货车',
        'H22' => '中型厢式货车',
        'H23' => '中型封闭货车',
        'H25' => '中型平板货车',
        'H28' => '中型特殊结构货车',
        'H31' => '轻型普通货车',
        'H32' => '轻型厢式货车',
        'H33' => '轻型封闭货车',
        'H35' => '轻型平板货车',
        'H38' => '轻型特殊结构货车',
        'H41' => '微型普通货车',
        'H42' => '微型厢式货车',
        'H43' => '微型封闭货车',
        'H46' => '微型特殊结构货车',
        'M11' => '普通正三轮摩托车',
        'M12' => '轻便正三轮摩托车',
        'M13' => '正三轮载客摩托车',
        'M14' => '正三轮载货摩托车',
        'M15' => '侧三轮摩托车',
        'M21' => '普通二轮摩托车',
        'M22' => '轻便二轮摩托车',
        'N11' => '三轮农用运输车',
    ];

    /**
     * 关系人类型
     * @var array $relationTypeCode
     */
    public static $relationTypeCode = [
        'R1' => '1',
        'R2' => '3',
        'R3' => '2'
    ];

    /**
     * 关系人证件类型
     * @var array $certificateTypeCode
     */
    public static $certificateTypeCode = [
        '01' => '01',
        '02' => '99',
        '03' => '02',
        '04' => '553',
        '05' => '99',
        '50' => '10',
        '51' => '11',
        '52' => '13',
        '99' => '99',
    ];

    /**
     * 缴税类型
     * @var array $taxTypeCode
     */
    public static $taxTypeCode = [
        'T01' => '3T5002',
        'T02' => '3T5005',
        'T03' => '3T5004',
        'T04' => '3T5003',
        'T05' => '',
        'T06' => '',
        'T07' => '',
        'T08' => '',
    ];

    /**
     * 减免税方案代码
     * @var array $taxReductionCode
     */
    public static $taxReductionCode = [
        'E' => '免税',
        'P' => '比例减免',
        'A' => '金额减免'
    ];

    /**
     * 减免税原因代码
     * @var array $taxReductionReasonCode
     */
    public static $taxReductionReasonCode = [
        'TRR1' => '3T2007',
        'TRR2' => '3T2001',
        'TRR3' => '3T2002',
        'TRR4' => '3T2003',
        'TRR5' => '3T2004',
        'TRR6' => '3T2006',
        'TRR7' => '3T2008',
    ];

    /**
     * 险种代码
     * @var array $coverageCode
     */
    public static $coverageCode = [
        //交强险
        'C01001' => '机动车交通事故责任强制保险',
        //商业险
        'C02001' => '030006',
        'C02002' => '032601',
        'C02003' => '033007',
        'C02004' => '033501',
        'C02005' => '033502',
        'C02006' => '033507',
        'C02007' => '030021',
        'C02008' => '030064',
        'C02009' => '附加保险人指定修理厂特约险',

        'C03001' => '030018',
        'C03002' => '033024',
        'C03003' => '033006',
        'C03004' => '033512',
        'C03005' => '033508',

        'C04001' => '030001',
        'C04002' => '033515',
        'C04003' => '033513',
        'C04004' => '033509',

        'C05001' => '030009',
        'C05002' => '033005',
        'C05003' => '033514',
        'C05004' => '033510',

        'C08001' => '033503',
        'C08002' => '033504',
        'C08003' => '033505',
        'C08004' => '033506',

        //新能源商业险
        'C12001' => '030006',
        'C12002' => '032601',
        'C12003' => '033007',
        'C12004' => '033501',
        'C12006' => '033507',
        'C12007' => '030021',
        'C12008' => '030064',

        'C13001' => '030018',
        'C13002' => '033024',
        'C13003' => '033006',
        'C13004' => '033512',
        'C13005' => '033508',

        'C14001' => '030001',
        'C14002' => '033515',
        'C14003' => '033513',
        'C14004' => '033509',

        'C15001' => '030009',
        'C15002' => '033005',
        'C15003' => '033514',
        'C15004' => '033510',

        'C16001' => '033516',
        'C16002' => '033517',
        'C16003' => '033518',
        'C16004' => '附加智能辅助驾驶软件损失补偿险',
        'C16005' => '附加火灾事故限额翻倍险',

        'C18001' => '033503',
        'C18002' => '033504',
        'C18003' => '033505',
        'C18004' => '033506',
    ];

    /**
     * 玻璃材质
     * @var array $coverageModeCode
     */
    public static $coverageModeCode = [
        'M1' => '国产',
        'M2' => '进口',
        'M3' => '国产(特殊材质)',
        'M4' => '进口(特殊材质)',
    ];

    /**
     * 充电桩种类
     * @var string[] $chargePileKind
     */
    public static $chargingPileKind = [
        'PK1' => '3A3001',
        'PK2' => '3A3002',
        'PK9' => '3A3003'
    ];

    /**
     * 充电桩安装地点类型
     * @var string[] $chargingPileAddressType
     */
    public static $chargingPileAddressType = [
        'PA1' => '3A2001',
        'PA2' => '3A2002'
    ];

    /**
     * 充电桩使用年限
     * @var array $chargingPileYearLimit
     */
    public static $chargingPileYearLimit = [
        'PY1' => '2年及以内',
        'PY2' => '2-5(含)年',
        'PY3' => '5年以上'
    ];

    /**
     * 验车情况
     * @var string[] $carCheckCode
     */
    public static $carCheckCode = [
        'CS1' => '未验车',
        'CS2' => '免验车',
        'CS3' => '已验车',
        'CS4' => '待补资料'
    ];

    /**
     * 免验原因
     * @var array $carCheckReasonKind
     */
    public static $carCheckReasonKind = [
        'CR1' => '单保责任险',
        'CR2' => '按期续保',
        'CR3' => '新车',
        'CR4' => '团单',
        'CR5' => '协议免验',
        'CR6' => '低验车风险',
        'CR7' => '其他原因',
        'CR8' => '符合免验规定',
        'CR9' => '按期转保',
        'CR10' => '未投保损失险别'
    ];

    /**
     * 核保状态
     * @var array $underStats
     */
    public static $underStats = [
        'U1' => '核保通过',
        'U2' => '退回修改',
        'U3' => '人工核保',
        'U4' => '核保失败',
        'U5' => '已出保单',
        'U6' => '拒保',
        'U7' => '待审核',
    ];

    /**
     * 上传文件类型
     * @var array $uploadFileType
     */
    public static $uploadFileType = [
        '10001' => '01',//投保人身份证正面照
        '10002' => '01',//投保人身份证反面照
        '10003' => '01',//投保人组织机构代码证照

        '10004' => '01',//被保人身份证正面照
        '10005' => '01',//被保人身份证反面照
        '10006' => '01',//被保人组织机构代码证照

        '10007' => '01',//车主身份证正面照
        '10008' => '01',//车主身份证反面照
        '10009' => '99',//车主组织机构代码证照

        '10010' => '99',//行驶证正页照
        '10011' => '99',//行驶证副页照

        '10012' => '11',//驾驶证正页照
        '10013' => '11',//驾驶证副页照

        '10014' => '99',//车辆正面照片
        '10015' => '99',//车辆正后照片

        '10100' => '99',//'验车照片3',
        '10101' => '99',//'验车照片4',
        '10102' => '99',//'验车照片5',
        '10103' => '99',//'验车照片6',
        '10104' => '99',//'验车照片7',
        '10105' => '99',//'验车照片8',
        '10106' => '99',//'验车照片9',
        '10107' => '99',//'验车照片10',

        '10016' => '99',//合格证
        '10017' => '99',//完税证明
        '10018' => '99',//车辆登记证书
        '10019' => '99',//上年商业险保单照
        '10020' => '99',//上年交强险保单照
        '10021' => '99',//新车发票照
        '90001' => '99',//'其他资料1',
        '90002' => '99',//'其他资料2',
        '90003' => '99',//'其他资料3',

        '90004' => '99',//'关系证明',
        '90009' => '99',//'其他',
    ];

    public static $uploadFileTypeName = [
        '01' => '居民身份证',
        '11' => '驾驶证',
        '99' => '其他',
    ];

    /**
     * 特约类型
     * @var string[] $clauseType
     */
    public static $clauseType = [
        '0' => '未知',
        '1' => '固定特约',
        '2' => '替换特约',
        '3' => '填空特约',
        '4' => '替换和填空特约'
    ];


    /**
     * 机构类型
     * organizationType
     * @var string[] $organizationType
     */
    public static $organizationType = [
        '02' => '个体工商户',
        '03' => '企业非法人',
        '04' => '企业法人',
        '05' => '机关法人',
        '06' => '机关非法人',
        '07' => '事业法人',
        '08' => '事业非法人',
        '09' => '社团法人',
        '10' => '社团非法人',
        '11' => '工会法人',
        '12' => '民办非企业单位',
        '13' => '其他',
    ];

    /**
     * 非车失败
     * nonCarStatus
     * @var array $nonCarStatus
     */
    public static $nonCarStatus = [
        'success',
        'error',
        'part'
    ];
}
